﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Linq;

namespace Omnia.DataModels
{
    public class TransactionGroupInfo
    {
        public TransactionGroupInfo() { }

        public TransactionGroupInfo(IEnumerable<TransactionInfo> transactions, int year,int month,int day)
        {
            TransactionCollection = new ObservableCollection<TransactionInfo>(transactions);
            Date = new DateTime(year, month, day);
            Sum = transactions.Sum(t => t.Amount);
        }

        public ObservableCollection<TransactionInfo> TransactionCollection { get; set; }
        public double Sum { get; set; }
        public DateTime Date { get; set; }
    }
}
